package cn.duli.myvideo.service.Impl;

import cn.duli.myvideo.mapper.CollectVarietyMapper;
import cn.duli.myvideo.pojo.CollectVariety;
import cn.duli.myvideo.service.CollectVarietyService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CollectVarietyServiceImpl implements CollectVarietyService {

    @Resource
    private CollectVarietyMapper collectVarietyMapper;

    @Override
    public Page<CollectVariety> findAll() {
        return collectVarietyMapper.findAll();
    }

    @Override
    public Integer findCountByVarietyId(Integer vId) {
        return collectVarietyMapper.findCountByVarietyId(vId);
    }

    @Override
    public List<CollectVariety> findByUserId(Integer uId) {
        return collectVarietyMapper.findByUserId(uId);
    }

    @Override
    public List<CollectVariety> findByVarietyId(Integer vId) {
        return collectVarietyMapper.findByVarietyId(vId);
    }

    @Override
    public void save(CollectVariety collectVariety) {
        collectVarietyMapper.save(collectVariety);
    }

    @Override
    public void deleteById(Integer cvId) {
        collectVarietyMapper.deleteById(cvId);
    }
}
